This code shows how an error response is written:
"responseStatus": { "errorCode": "CUSTOMDATA_EXCEEDED", "message": "Too much custom data. Custom data is limited to 1 MByte|4345663", "errors": [ { "errorCode": "CUSTOMDATA_EXCEEDED", "fieldName": "CustomData", "message": "Too much custom data. Custom data is limited to 1 MByte." } ] }
For the error message we need two parameters:
the errorCode is a code that can be used by developer to manage the applications reaction during run time. The errorCode should be unique in order to identify it on client side as exact as possible. It consists of capital letters and underline characters in between, e.g. TYPE_OF_EXCEPTION. We will not use the notation TypeOfException.
the message is an English speaking textual message for developer during development time - it is not intended to be interpreted during runtime and should not be used in an application. We may change this whenever we want. The message should give as much detailed information as possible (e.g. Stop has invalid parameter x) and a solution hint (e.g. please provide data in format y). If errorCode is "SUCCESS", the "message" contains the SequenceID generated in the API for log tracking.
© 2022 PTV Planung Transport Verkehr GmbH | Imprint